package com.lyl.domaindemo.Infrastructure.exception;

import com.lyl.domaindemo.Infrastructure.enums.ErrorStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author lyl
 * @date 2023/5/19
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DomainException extends Exception{

    private String errorCode;

    private String messageEn;

    private String messageCn;

    public DomainException(ErrorStatusEnum commonStatusEnum){
        this.errorCode = commonStatusEnum.getCode();
        this.messageEn  = commonStatusEnum.getMessageEn();
        this.messageCn = commonStatusEnum.getMessageCn();
    }
}
